package com.khoayang.littlefighterchaos.menu;
import org.cocos2d.layers.CCLayer;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.types.CGPoint;
import org.cocos2d.types.CGSize;

public class BackgroundLayer extends CCLayer{
	private CCSprite _backgroundSprite;

	public BackgroundLayer(String backgroundFile){
		_backgroundSprite = CCSprite.sprite(backgroundFile);
		addChild(_backgroundSprite);
		CGSize winSize = CCDirector.sharedDirector().displaySize();
		_backgroundSprite.setPosition(CGPoint.ccp(winSize.width/2.0f, winSize.height/2.0f));
		_backgroundSprite.setScaleX(winSize.width/_backgroundSprite.getContentSize().width);
		_backgroundSprite.setScaleY(winSize.height/_backgroundSprite.getContentSize().height);
	}
}